package com.styytech.dadabao.test.photoviewer;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;

import com.styytech.dadabao.widge.photoview.myzoomview.ImagePagerActivity;

import java.util.ArrayList;

/**
 * 图片缩放，多张图片浏览
 */
public class photoViewerActivity extends Activity {

    private Context mContext;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        TextView tv_content = new TextView(this);
        setContentView(tv_content);
        tv_content.setText("按返回键退出到测试模块列表");
        mContext = photoViewerActivity.this;
        showImage();
    }

    /**
     * 显示图片原图支持可缩放效果
     */
    private void showImage() {
        Intent intent = new Intent(mContext, ImagePagerActivity.class);
        ArrayList<String> imgUrls = new ArrayList<String>();
        imgUrls.add("http://www.shstzz.com/ydimages/001.jpg");
        imgUrls.add("http://www.shstzz.com/ydimages/002.jpg");
        imgUrls.add("http://www.shstzz.com/ydimages/003.jpg");
        imgUrls.add("http://www.shstzz.com/ydimages/004.jpg");
        imgUrls.add("http://www.shstzz.com/ydimages/005.jpg");
        intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_URLS, imgUrls);
        intent.putExtra(ImagePagerActivity.EXTRA_IMAGE_INDEX, 0);
        intent.putExtra("isIndex", true);//是否显示下标(默认false)
        intent.putExtra("isZoom", true);//是否可以缩放（默认false）
        startActivity(intent);
    }
}
